@import url(https://fonts.googleapis.com.css?family=Open+Sans:600);

.frame{
    position: absolute;
    width: 400px;
    height: 400px;
    inset: 0;
    margin: auto;
    box-shadow: 1px 2px 10px rgba(0,0,0,0.3);
    border-radius: 2px;
    background: #2c3e50;
    color: #fff;
    font-family: 'Open Sans', Helvetica, sans-serif;
    overflow: hidden;
}

.circle{
    position: absolute;
    width: 200px;
    height: 200px;
    top: 70px;
    left: 100px;
    border-radius: 50%;
    background: #354a5f;
}
.circle-outer{
    @extend .circle;
    box-sizing: border-box;
    background: none;
    border: 4px solid #354a5f;
}

.icon{
    position: absolute;
    z-index: 2;
    top: 135px;
    left: 140px;
    fill: none;
    stroke-width: 2px;
    transform: translate3d(0,0,0);
    stroke: #ecf0f1;
    stroke-linecap: square;
    stroke-dasharray: 325 325;

    &.mail{
        width: 120px;
        height: 70px;
        stroke-dashoffset: 0;
    }
    &.plane{
        width: 120px;
        height: 110px;
        stroke-dashoffset: 325;
    }
}

#cb{
    display: none;
}

.button{
    position: absolute;
    z-index: 10;
    width: 200px;
    height: 40px;
    left: 100px;
    bottom:70px;
    text-align: center;
    line-height: 40px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 15px;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 20px;

    &.reset{
        opacity: 0;
        z-index: 5;
    }

    &:hover{
        background: #1abc9c;
        color: #fff;
    }
}

#cb:checked ~ .button{
    animation: button 1.5s ease-in-out 1.7s;
    animation-fill-mode: both;
}

#cb:checked ~ .reset{
    animation: reset 1s ease-in-out 3.7s;
    animation-fill-mode: both;
}

#cb:checked ~.circle{
    animation: circle 1s ease-in-out;
    animation-fill-mode: both;
}

#cb:checked ~.circle-outer{
    animation: circle .8s ease-in-out .2s;
    animation-fill-mode: both;
}

#cb:checked ~.mail{
    stroke-dashoffset: 326;
    transition: stroke-dashoffset 1s ease-in-out;
}

#cb:checked ~.plane{
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s ease-in-out .6s;
    animation: fly 2.4s ease-in-out;
    animation-fill-mode: both;
}

@keyframes fly {
    0%,50%{
        transform: translate3d(0,0,0) scale(1);
    }
    60%{
        transform: translate3d(-10px, 5px ,0) scale(1.05);
    }
    70%{
        opacity: 1;
    }
    85%{
        opacity: 0;
    }
    100%{
        transform: translate3d(300px, -150px, 0) scale(0.4);
        opacity: 0;
    }
}

@keyframes circle {
    0%{
        transform: scale(1);
    }
    20%{
        transform: scale(1.1);
    }
    100%{
        transform: scale(0);
    }
}

@keyframes button {
    0%{
        transform: scale(1);
    }
    30%{
       background-color: #1abc9c; 
       color: transparent;
       width: 200px;
       left: 100px;
    }
    50%,60%{
        width: 40px;
        left: 180px;
        transform: scale(1);
    }
    70%{
        transform: scale(1.1);
    }
    100%{
        width: 40px;
        left: 180px;
        background: #1abc9c;
        color: transparent;
        transform: scale(0);
    }
}

@keyframes reset {
    from{
        opacity: 0;
    }
    to{
        opacity: 1;
    }
}